home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2065 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.5 KB  |  62 lines

  1. Newsgroups: comp.lang.c++
  2. Path: newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news
  3. From: Mark Seaborn <cms024@email.mot.com>
  4. Subject: Re: template functions
  5. Content-Type: text/plain; charset=us-ascii
  6. Organization: MOTOROLA 
  7. Date: Mon, 15 Jan 1996 10:22:21 -0600
  8. Message-ID: <30FA7F3D.6722@email.mot.com>
  9. X-Mailer: Mozilla 2.0b5 (Macintosh; I; 68K)
  10. Mime-Version: 1.0
  11. Content-Transfer-Encoding: 7bit
  12. References: <4d5cd4$hli@ousrvr3.oulu.fi>
  13. Sender: news@schbbs.mot.com (SCHBBS News Account)
  14. Nntp-Posting-Host: 145.1.202.19
  15.  
  16. What I usually do in this case is create a header for the class 
  17. protocol and then use the scope operator to define the class in 
  18. another file
  19.  
  20. class.h
  21.  
  22. template <class ElemType> 
  23. class foo
  24. {
  25.   foo()
  26.   ~foo();
  27.   int getfoo();
  28. };
  29.  
  30. class.C
  31. template <class ElemType>
  32. foo<ElemType>::foo()
  33. {
  34. }
  35.  
  36. template <class ElemType>
  37. foo<ElemType>::~foo()
  38. {
  39. }
  40.  
  41. template <class ElemType>
  42. int foo<ElemType>::getfoo()
  43. {
  44. }
  45. -- 
  46. ********************************************************************
  47. *
  48. * Mark Seaborn          | ITTTools  : mseaborn@itthp1.comm.mot.com  
  49. *
  50. * Motorola              | KU        : mseaborn@hawk.cs.ukans.edu    
  51. *
  52. * 1301 E. Algonquin Rd. | Macintosh : cms024@email.mot.com          
  53. *
  54. * Schaumburg, IL. 60196 | Voice     : 708/538-5303                  
  55. *
  56. * Maildrop: IL02/Rm0442 | Fax       : 708/576-2619                  
  57. *
  58. ********************************************************************
  59. *
  60. * AKA : Conan the Saute' Man                                        
  61. *
  62.